Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Implement True Force Switch (Roar, Whirlwind, Circle Throw, Dragon Tail) #4881

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from

Conversation

EvasiveAce
Copy link
Contributor

@EvasiveAce EvasiveAce commented Nov 16, 2024

What are the changes the user will see?

Force switching moves, such as Roar, will now randomly switch to a party member if applicable.

Why am I making these changes?

Fixes #4296
Turns the partial moves into fully implemented.

What are the changes from a developer perspective?

Very little, I implemented "Force_Switch" on the SwitchType Enum, everything should be done in move.ts and affects very little.

Screenshots/Videos

Battle to show that Trainers are random; the previous version would not allow combusken to be sent out if selected, due to the type advantage, as far as I know.

2024-11-15.21-25-53.mp4

Battle to show that Roar works on the player.

2024-11-15.21-38-51.mp4

How to test the changes?

Make the trainer have all roar while you have any non damaging move. Vice verse to test the other side.

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I considered writing automated tests for the issue?
  • If I have text, did I make it translatable and add a key in the English locale file(s)?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • Are the changes visual?
    • Have I provided screenshots/videos of the changes?

Copy link
Collaborator

@DayKev DayKev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed a couple mistakes, PR here: EvasiveAce#1

Copy link
Collaborator

@DayKev DayKev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should mention exactly what I changed, so:

@@ -5979,7 +5979,21 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
return false;
}

if (switchOutTarget.hp > 0) {
if (switchOutTarget.hp && SwitchType.FORCE_SWITCH) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the this.switchType === is missing.

if (switchOutTarget.hp && SwitchType.FORCE_SWITCH) {
switchOutTarget.leaveField(this.switchType === SwitchType.FORCE_SWITCH);
const slotIndex = Utils.randIntRange(user.scene.currentBattle.getBattlerCount(), user.scene.getPlayerParty().length);
user.scene.unshiftPhase(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing code uses prependToPhase(..., MoveEndPhase) so I swapped the new code to use that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] True force-switch (Roar, Whirlwind, Circle Throw, Dragon Tail...)
2 participants